package com.ingsing.user.service.impl;

import com.ingsing.user.model.po.UserInfo;
import com.ingsing.user.mapper.UserInfoMapper;
import com.ingsing.user.service.IUserInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * @author: NALHOUG
 * @time: 2019/10/18 16:09
 * @explain
 */
@Service
public class UserInfoServiceImpl implements IUserInfoService {
    @Resource
    private UserInfoMapper userInfoMapper;

    @Override
    public UserInfo checkUserInfo(Integer userId) {
        return userInfoMapper.selectById(userId);
    }

    @Override
    public int newUserInfo(UserInfo userInfo) {
        return userInfoMapper.insert(userInfo);
    }
    @Override
    public int updateUserInfo(UserInfo userInfo,int userId) {
        return userInfoMapper.update(userInfo,null);
    }

    @Override
    public UserInfo selectUserInfo(int userId) {
        return userInfoMapper.selectByUserId(userId);
    }
}
